<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      /*
        实例化类，类构建对象， new 类
        ① 自动执行 constructor 方法
        ② 返回一个对象给 new
        constructor 执行
        ①
        ②
        ③
      */
      class Person {
        constructor() {
          this.username = "jack";
        }
        say() {
          console.log("hello jack");
        }
      }
      const p1 = new Person();
      const p2 = new Person();
      console.log(p1.say === p2.say);
    </script>
  </body>
</html>
